﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using org.sablecc.grammars.java_1_5.node;

namespace Commander.Parsing {
  public class MethodInformation {
    public List<PFormalParameter> Parameters { get; set; }
		public string FullMethod { get; set; }
    public string MethodName { get; set; }
		public List<ASimpleMethodInvocation> Invocations { get; set; }
    public PMethodBody Body { get; set; }
    public Dictionary<Node, PLocalVariableDeclaration> ScopeAndVariable { get; set; }
    public List<PLocalVariableDeclaration> LocalVariables { get; set; }
    public TypedList Modifiers { get; set; }
    public AMarkerAnnotation Annotation { get; set; }
    
    public MethodInformation() {
			Invocations = new List<ASimpleMethodInvocation>();
      ScopeAndVariable = new Dictionary<Node, PLocalVariableDeclaration>();
			Parameters = new List<PFormalParameter>();
      LocalVariables = new List<PLocalVariableDeclaration>();
    }

    public override string ToString() {
      return (Body == null) ? String.Empty : Body.ToString();
    }
  }

  public class InterfaceInformation {
    public List<PFieldDeclaration> Fields { get; set; }
    public List<MethodInformation> Methods { get; set; }

    public InterfaceInformation() {
      Fields = new List<PFieldDeclaration>();
      Methods = new List<MethodInformation>();
    }
  }

  public class ClassInformation {
    public string Name { get; set; }
    public TypedList Modifiers { get; set; }
    public List<PFieldDeclaration> Fields { get; set; }
    public List<MethodInformation> Methods { get; set; }
    public List<PImportDeclaration> Imports { get; set; }
    public AClassBody Body { get; set; }
    public AMarkerAnnotation Annotation { get; set; }
    public List<ClassInformation> InnerClasses { get; set; }
    public List<InterfaceInformation> InnerInterfaces { get; set; }
    public String Packages { get; set; }
    //Add constructor Info? may later
    public ClassInformation() {
      Fields = new List<PFieldDeclaration>();
      Methods = new List<MethodInformation>();
      Imports = new List<PImportDeclaration>();
      InnerClasses = new List<ClassInformation>();
      InnerInterfaces = new List<InterfaceInformation>();
    }

    public override string ToString() {
      return (Body == null) ? String.Empty : Body.ToString();
    }
  }
}
